import request from '@/utils/request'

// 获取行业一级列表
export function getTopList() {
  return request({
    url: '/admin/industry/admin/get_top_list',
    method: 'get'
  })
}

// 根据id获取子节点数据
export function getChildrenList(id) {
  return request({
    url: '/admin/industry/admin/get_children_list',
    method: 'get',
    params: { id }
  })
}

// 新增行业
export function addIndustry(data) {
  return request({
    url: '/admin/industry/admin/add',
    method: 'post',
    data
  })
}

// 更新行业
export function updateIndustry(data) {
  return request({
    url: '/admin/industry/admin/edit',
    method: 'put',
    data
  })
}

// 删除行业
export function deleteIndustry(id) {
  return request({
    url: '/admin/industry/admin/del',
    method: 'delete',
    params: { id }
  })
}


// 刷新系统缓存
export function refreshCache() {
  return request({
    url: '/admin/industry/admin/refreshIndustry',
    method: 'post'
  })
}